* to the computations individual esi snippets need. Most importantly no body
* parsing for most of those of course.
*
- * PHPTAL support has been moved to a subclass in SkinPHPTal.php,
- * and is optional. You'll need to install PHPTAL manually to use
- * skins that depend on it.
- *
* @package MediaWiki
* @subpackage Skins
*/
/**
* For QuickTemplate, the name of the subclass which
* will actually fill the template.
- *
- * In PHPTal mode, name of PHPTal template to be used.
- * '.pt' will be automaticly added to it on PHPTAL object creation
*/
var $template;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
global $wgUseTrackbacks;
+ global $wgDBname;
$fname = 'SkinTemplate::outputPage';
wfProfileIn( $fname );
} else {
$tpl->set('jsvarurl', false);
}
- if( $wgUser->getNewtalk() ) {
+ $newtalks = $wgUser->getNewMessageLinks();
+
+ if (count($newtalks) == 1 && $newtalks[0]["wiki"] === $wgDBname) {
$usertitle = $this->mUser->getUserPage();
$usertalktitle = $usertitle->getTalkPage();
if( !$usertalktitle->equals( $this->mTitle ) ) {
$ntl = wfMsg( 'youhavenewmessages',
$this->makeKnownLinkObj(
$usertalktitle,
- wfMsgHtml( 'newmessageslink' )
+ wfMsgHtml( 'newmessageslink' ),
+ 'redirect=no'
),
$this->makeKnownLinkObj(
$usertalktitle,
# Disable Cache
$wgOut->setSquidMaxage(0);
}
+ } else if (count($newtalks)) {
+ $sep = str_replace("_", " ", wfMsgHtml("newtalkseperator"));
+ $msgs = array();
+ foreach ($newtalks as $newtalk) {
+ $msgs[] = wfElement("a",
+ array('href' => $newtalk["link"]), $newtalk["wiki"]);
+ }
+ $parts = implode($sep, $msgs);
+ $ntl = wfMsgHtml('youhavenewmessagesmulti', $parts);
+ $wgOut->setSquidMaxage(0);
} else {
$ntl = '';
}
$sql = "SELECT COUNT(*) AS n FROM $watchlist
WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) .
"' AND wl_namespace=" . $this->mTitle->getNamespace() ;
- $res = $dbr->query( $sql, 'SkinPHPTal::outputPage');
+ $res = $dbr->query( $sql, 'SkinTemplate::outputPage');
$x = $dbr->fetchObject( $res );
$numberofwatchingusers = $x->n;
if ($numberofwatchingusers > 0) {
* @access private
*/
function buildPersonalUrls() {
- global $wgTitle, $wgShowIPinHeader, $wgContLang;
+ global $wgTitle, $wgShowIPinHeader;
$fname = 'SkinTemplate::buildPersonalUrls';
$pageurl = $wgTitle->getLocalURL();
* @access private
*/
function buildContentActionUrls () {
- global $wgContLang, $wgDBprefix;
+ global $wgContLang;
$fname = 'SkinTemplate::buildContentActionUrls';
wfProfileIn( $fname );
$subjpage = $this->mTitle->getSubjectPage();
$talkpage = $this->mTitle->getTalkPage();
- $nskey = $this->getNameSpaceKey();
+ $nskey = $this->mTitle->getNamespaceKey();
$content_actions[$nskey] = $this->tabAction(
$subjpage,
$nskey,
wfProfileIn( $fname );
global $wgUser, $wgRequest;
- global $wgSiteSupportPage, $wgEnableUploads, $wgUploadNavigationUrl;
+ global $wgEnableUploads, $wgUploadNavigationUrl;
$action = $wgRequest->getText( 'action' );
$oldid = $wgRequest->getVal( 'oldid' );
$diff = $wgRequest->getVal( 'diff' );
$nav_urls = array();
- $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
+ $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
if( $wgEnableUploads ) {
if ($wgUploadNavigationUrl) {
$nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );
// A print stylesheet is attached to all pages, but nobody ever
// figures that out. :) Add a link...
if( $this->iscontent && ($action == '' || $action == 'view' || $action == 'purge' ) ) {
- $revid = $wgArticle->getRevIdFetched();
+ $revid = $wgArticle->getLatest();
if ( !( $revid == 0 ) )
$nav_urls['print'] = array(
'text' => wfMsg( 'printableversion' ),
$nav_urls['contributions'] = array(
'href' => $this->makeSpecialUrl('Contributions/' . $this->mTitle->getText() )
);
- if ( $wgUser->isAllowed( 'protect' ) )
+ if ( $wgUser->isAllowed( 'block' ) )
$nav_urls['blockip'] = array(
'href' => $this->makeSpecialUrl( 'Blockip/' . $this->mTitle->getText() )
);
* @access private
*/
function getNameSpaceKey () {
- switch ($this->mTitle->getNamespace()) {
- case NS_MAIN:
- case NS_TALK:
- return 'nstab-main';
- case NS_USER:
- case NS_USER_TALK:
- return 'nstab-user';
- case NS_MEDIA:
- return 'nstab-media';
- case NS_SPECIAL:
- return 'nstab-special';
- case NS_PROJECT:
- case NS_PROJECT_TALK:
- return 'nstab-wp';
- case NS_IMAGE:
- case NS_IMAGE_TALK:
- return 'nstab-image';
- case NS_MEDIAWIKI:
- case NS_MEDIAWIKI_TALK:
- return 'nstab-mediawiki';
- case NS_TEMPLATE:
- case NS_TEMPLATE_TALK:
- return 'nstab-template';
- case NS_HELP:
- case NS_HELP_TALK:
- return 'nstab-help';
- case NS_CATEGORY:
- case NS_CATEGORY_TALK:
- return 'nstab-category';
- default:
- return 'nstab-' . strtolower( $this->mTitle->getSubjectNsText() );
- }
+ return $this->mTitle->getNamespaceKey();
}
/**
$fname = 'SkinTemplate::getUserStylesheet';
wfProfileIn( $fname );
- global $wgUser;
$s = "/* generated user stylesheet */\n";
$s .= $this->reallyDoGetUserStyles();
wfProfileOut( $fname );